<? 
	include('base.php');
	User::protect();
	include_class('tours');
	$page_title = 'View/Edit Tours';
	$section = 'tours';
	include('layout/header.php');
?>

<div id="breadcrumb">
	<a href="index.php">Audition &#62;</a>
	<a href="live.php">Live &#62;</a>
	Tours
</div>

	<h1>tours:</h1>
	<div class="inset">
	<p>
	<?
		$tours = new TourList();
		$tourlist = $tours->get_tours($_GET['entries_per_page'], $_GET['start']);
		$news_total = $tours->get_total();
	?>
	<form id="amount_form" action="<?=$PHP_SELF?>" method="get">
		<? if (User::isAdmin())  { ?><a href="tour_add.php">Add Tour</a><span class="padded">|</span><? } ?>
		<? include('layout/paging.php'); ?>
	</form>
	</p>
	<p>
	<table class="list" border="0" cellspacing="1" cellpadding="0">
	<tr>
		<td class="header">Start Date</td>
		<td class="header">End Date</td>
		<td class="header">Tour Title</td>
	</tr>
	<?
		if (is_array($tourlist) && count($tourlist) > 0) { 
		foreach ($tourlist as $to) { ?>
		<tr>
			<td valign="top"><?=$to->getStartDate()?></td>
			<td valign="top"><?=$to->getEndDate()?></td>
			<td valign="top" width="60%"><a href="tour_edit.php?id=<?=$to->getID()?>"><?=$to->getTitle()?></a><? if (!$to->isActive()) { ?><img src="images/inactive.gif" alt="Entry is Inactive" width="10" height="10" title="Entry is Inactive"><? } ?></td>
		</tr>				
		<? }
		} else {
	?>
		<tr>
			<td colspan="3">No tours.</td>
		</tr>
	<? } ?>
	</table>
	</p>		
	</div>
